package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.AtmCassetteOrgMapper;
import com.zone.service.domain.AtmCassetteOrg;
import com.zone.service.service.IAtmCassetteOrgService;

/**
 * ATM钞箱机构Service业务层处理
 * 
 * @author liuyang
 * @date 2025-10-30
 */
@Service
public class AtmCassetteOrgServiceImpl implements IAtmCassetteOrgService 
{
    @Autowired
    private AtmCassetteOrgMapper atmCassetteOrgMapper;

    /**
     * 查询ATM钞箱机构
     * 
     * @param id ATM钞箱机构主键
     * @return ATM钞箱机构
     */
    @Override
    public AtmCassetteOrg selectAtmCassetteOrgById(Long id)
    {
        return atmCassetteOrgMapper.selectAtmCassetteOrgById(id);
    }

    /**
     * 查询ATM钞箱机构列表
     * 
     * @param atmCassetteOrg ATM钞箱机构
     * @return ATM钞箱机构
     */
    @Override
    public List<AtmCassetteOrg> selectAtmCassetteOrgList(AtmCassetteOrg atmCassetteOrg)
    {
        return atmCassetteOrgMapper.selectAtmCassetteOrgList(atmCassetteOrg);
    }

    /**
     * 新增ATM钞箱机构
     * 
     * @param atmCassetteOrg ATM钞箱机构
     * @return 结果
     */
    @Override
    public int insertAtmCassetteOrg(AtmCassetteOrg atmCassetteOrg)
    {
        atmCassetteOrg.setCreateTime(DateUtils.getNowDate());
        return atmCassetteOrgMapper.insertAtmCassetteOrg(atmCassetteOrg);
    }

    /**
     * 修改ATM钞箱机构
     * 
     * @param atmCassetteOrg ATM钞箱机构
     * @return 结果
     */
    @Override
    public int updateAtmCassetteOrg(AtmCassetteOrg atmCassetteOrg)
    {
        atmCassetteOrg.setUpdateTime(DateUtils.getNowDate());
        return atmCassetteOrgMapper.updateAtmCassetteOrg(atmCassetteOrg);
    }

    /**
     * 批量删除ATM钞箱机构
     * 
     * @param ids 需要删除的ATM钞箱机构主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteOrgByIds(Long[] ids)
    {
        return atmCassetteOrgMapper.deleteAtmCassetteOrgByIds(ids);
    }

    /**
     * 删除ATM钞箱机构信息
     * 
     * @param id ATM钞箱机构主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteOrgById(Long id)
    {
        return atmCassetteOrgMapper.deleteAtmCassetteOrgById(id);
    }
    
    /**
     * 批量新增ATM钞箱机构
     * 
     * @param atmCassetteOrgList ATM钞箱机构列表
     * @return 结果
     */
    @Override
    public int insertAtmCassetteOrgList(List<AtmCassetteOrg> atmCassetteOrgList)
    {
        int rows = 0;
        for (AtmCassetteOrg atmCassetteOrg : atmCassetteOrgList) {
            atmCassetteOrg.setCreateTime(DateUtils.getNowDate());
            rows += atmCassetteOrgMapper.insertAtmCassetteOrg(atmCassetteOrg);
        }
        return rows;
    }

    /**
     * 批量插入ATM钞箱机构数据
     *
     * @param atmCassetteOrgList
     * @return 结果
     */
    @Override
    public int batchInsertAtmCassetteOrg(List<AtmCassetteOrg> atmCassetteOrgList) {
        return atmCassetteOrgMapper.batchInsertAtmCassetteOrg(atmCassetteOrgList);
    }
}